#include "qos_manager.h"
#include <unistd.h>
#include "concurrent_task_log.h"

namespace OHOS {
namespace ConcurrentTask {

int QosManager::SetQosPolicy(struct qos_policy_datas *policy_datas)
{
    return QosPolicy(policy_datas);
}

void QosManager::Init()
{
    int ret;

    ret = SetQosPolicy(&default_qos_policy);
    if (ret) {
        CONCUR_LOGE("%{public}d set default_qos_policy failed", getuid());
    }

    ret = SetQosPolicy(&foreground_qos_policy);
    if (ret) {
        CONCUR_LOGE("%{public}d set foreground_qos_policy failed", getuid());
    }

    ret = SetQosPolicy(&background_qos_policy);
    if (ret) {
        CONCUR_LOGE("%{public}d set background_qos_policy failed", getuid());
    }

    ret = SetQosPolicy(&system_server_qos_policy);
    if (ret) {
        CONCUR_LOGE("%{public}d set system_server_qos_policy failed", getuid());
    }
    CONCUR_LOGI("set qos policy finish");
}

}
}